<?php
	require '../include/library.inc.php';
	require '../include/admin_login.inc.php';
	
	$category_id = intval($_GET['category_id']);
	$publish = intval($_GET['publish']);
	
	if($category_id) {
		$sql = "UPDATE 
				  category
				SET
				  published = $publish
				WHERE
				  category_id = $category_id 
				 ";
		query($sql);
	}
  
	redirect($_SERVER['HTTP_REFERER']);
?>